package cn.userManager.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cn.userManager.po.User;
import cn.userManager.service.UserService;

@Controller
public class UserEdit {
	@Autowired
	private UserService userService;
	@RequestMapping(value = "/findpasswd", method = { RequestMethod.POST, RequestMethod.GET })
	public String findPasswd(HttpServletRequest request) throws Exception {
		String member_mobile = request.getParameter("member_mobile");
		String idCard = request.getParameter("idCard");
		User user = userService.selectByPhone(member_mobile);
		if (user != null && user.getIdcard() != null && user.getIdcard().equalsIgnoreCase(idCard)) {

		}
		return "/userManager/login_fail";
	}
	@RequestMapping("/editImform")
	public String editImform(HttpServletRequest request) throws Exception {
		User user=new User();
		String  useraccount=(String) request.getSession().getAttribute("useraccount");
		String userName=request.getParameter("userName");
		String gender=request.getParameter("gender");
		String payAccount=request.getParameter("payAccount");
		String workName=request.getParameter("workName");
		String number=request.getParameter("number");
		String address=request.getParameter("address");
		//userService.insertUser(user);
		return "/userManager/login_fail";
	}
	@RequestMapping("/test")
	public String test(HttpServletRequest request) throws Exception {
		
		
		User user=new User();
		String  useraccount=(String) request.getSession().getAttribute("useraccount");
		String userName=request.getParameter("userName");
		String gender=request.getParameter("gender");
		String payAccount=request.getParameter("payAccount");
		String workName=request.getParameter("workName");
		String number=request.getParameter("number");
		String address=request.getParameter("address");
		//userService.insertUser(user);
		return "/userManager/login_fail";
	}
}
